/**
 * Copyright 2020 OPSLI 快速开发平台 https://www.opsli.com
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.opsli.modulars.business.emergency.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.opsli.api.wrapper.business.emergency.EmergencyReportModel;
import org.opsli.api.wrapper.system.user.UserModel;
import org.opsli.modulars.business.emergency.entity.EmergencyReport;
import org.opsli.modulars.business.emergency.entity.LineSpotTreeMap;

import java.util.List;

/**
 * 应急事件 Mapper
 *
 * @author zk
 * @date 2021-09-15 13:51:58
 */
@Mapper
public interface EmergencyReportMapper extends BaseMapper<EmergencyReport> {

    List<EmergencyReportModel> findList(String devid);

    List<EmergencyReportModel> findListAll(String devid);

    List<EmergencyReportModel> findListByProjectId(String projectId);

    public List<EmergencyReport> getMyList( @Param("model") EmergencyReport announcementSendModel,@Param("beginSize") Integer beginSize,@Param("endSize") Integer endSize);

    public List<EmergencyReport> getMyListNew( @Param("model") EmergencyReport announcementSendModel,@Param("beginSize") Integer beginSize,@Param("endSize") Integer endSize);

    public List<EmergencyReport> getWeekList(String devid);

    //当天巡线
    Integer getTodayLine(String devid);
    //当月巡线
    Integer getMonthLine(String devid);
    //当天巡点
    Integer getTodaySpot(String devid);
    //当月巡点
    Integer getMonthSpot(String devid);
    //当天应急事件
    Integer getTodayEmergency(String devid);
    //当月应急事件
    Integer getMonthEmergency(String devid);

    Integer updateState(@Param("id")String id );

    Integer updateStateTwo(@Param("id")String id );

    Integer updateStateThree(@Param("id")String id );


    EmergencyReport findById(@Param("id")String id);

    LineSpotTreeMap getLine(@Param("devId")String devId,@Param("userName")String userName);

    LineSpotTreeMap getSpot(@Param("devId")String devId,@Param("userName")String userName);

    //查出所有巡检人员
    List<UserModel> findListName(@Param("devId")String devId);
}
